(function(){
	'use strict';

	var ctcTempModule = angular.module('zhxCtcTemplate',[]);

	ctcTempModule.run(['$templateCache',function($templateCache){

		//直线图框架模板
		$templateCache.put('zhx.ctc.template.vicco',
			'<div class="zhx-ctc-wrapper">' +
				'<div class="zhx-ctc-line-tab">' +
					'<ul class="iconfont icon-track-line-fill">' +
						'<li>K10</li>' +
						'<li>K16</li>' +
						'<li>K19</li>' +
						'<li>K20</li>' +
						'<li>K203</li>' +
						'<li>K205</li>' +
						'<li>104</li>' +
						'<li>105</li>' +
						'<li>121</li>' +
						'<li>150</li>' +
						'<li>210</li>' +
						'<li>222</li>' +
						'<li>232</li>' +
						'<li>510</li>' +
						'<li>512</li>' +
						'<li>708</li>' +
						'<li>910</li>' +
						'<li>920</li>' +
						'<li>925</li>' +
						'<li>930</li>' +
					'</ul>' +
				'</div>' +
				//ctc 头部 包括 车牌，线路信息 控制按钮 
				'<div class="zhx-ctc-header">' +
					//车牌 线路信息
					'<div class="zhx-ctc-header-plate">' +
						'<div class="zhx-ctc-header-p-num" ng-click="changeLine()">K16</div>' +
						'<div class="zhx-ctc-header-p-info">' +
							'<ul>' +
								'<li ng-repeat="line in lineStationOpts"><span>{{ line.displayName }}</span><span>{{ lineStationInfo[line.key] }}</span></li>' +
							'</ul>' +
						'</div>' +
					'</div>' +
					// 控制按钮
					'<div class="zhx-ctc-header-controllers">' +
						'<ul>' +
							'<li ng-repeat="ctrlBtn in ctrlButtons" ng-bind="ctrlBtn.displayName" ng-click="ctrlBtnClick($event,$index);"></li>' +
						'</ul>' +
					'</div>' +
				'</div>' +

				//ctc 直线图部分
				'<div class="zhx-ctc-center">' +
					// 直线图 图示
					'<div class="zhx-ctc-center-legend">' +
						'<ul>' +
							'<li><span class="iconfont icon-bus status_g"></span>正常</li>' +
							'<li><span class="iconfont icon-bus status_b"></span>进站</li>' +
							// '<li><span class="iconfont icon-bus status_o"></span>待发</li>' +
							'<li><span class="iconfont icon-bus status_y"></span>延时</li>' +
							'<li><span class="iconfont icon-bus status_d"></span>迟到</li>' +
							'<li><span class="iconfont icon-bus status_lb"></span>提前</li>' +
							// '<li><span class="iconfont icon-bus status_gy"></span>离线</li>' +
							'<li><span class="iconfont icon-bus status_pr"></span>满载</li>' +
							'<li><span class="iconfont icon-alert status_r"></span>报警</li>' +
							'<li><span class="iconfont icon-su status_r"></span>超速</li>' +
							'<li><span class="iconfont icon-roundleftfill status_r"></span>过近</li>' +
							'<li><span class="iconfont icon-roundrightfill status_r"></span>过远</li>' +
							'<li><span class="iconfont icon-icluxian"></span>超车</li>' +
							'<li><span class="iconfont icon-zadao status_gr"></span>甩站</li>' +
							// '<li><span class="iconfont icon-luxian status_lb"></span>偏线</li>' +
							// '<li><span class="iconfont icon-jinzhi status_gy"></span>停运</li>' +
						'</ul>' +
					'</div>' +
					'<div class="zhx-ctc-subline-tabs">' +
						'<ul>' +
							'<li ng-repeat="line in lineTab track by $index" ng-click="changeSubLine($event,line);" ng-class="{ active : lineActiveTab == line[lineTabOpts.id] }">{{ line[lineTabOpts.name] }}</li>' +
						'</ul>' +
					'</div>' +
					//直线图 左侧 上行待发 非运营
					'<div class="placing-area zhx-ctc-up-going">' +
						//上行待发
						'<div class="upgo-waiting-area">' +
							'<ul>' +
								'<li ng-repeat="bus in __lineBusArrObject.upReadyBus track by $index" class="iconfont icon-bus">' +
									'<span class="bus-no">{{ bus[__busKeyMap.busNoKey] }}</span>' +
									'<span class="bus-plan-time">{{ bus[__busKeyMap.planTimeKey] | busTimeFilter }}</span>' +
								'</li>' +
							'</ul>' +
						'</div>' +
						//非运营
						'<div class="upgo-non-service">' +
							'<ul>' +
								'<li ng-repeat="bus in __lineBusArrObject.upNonServiceBus track by $index" class="iconfont icon-bus">' +
									'<span class="bus-no">{{ bus[__busKeyMap.busNoKey] }}</span>' +
									'<span class="bus-plan-time">{{ bus[__busKeyMap.planTimeKey] | busTimeFilter }}</span>' +
								'</li>' +
							'</ul>' +
						'</div>' +
					'</div>' +
					//直线图 右侧 下行待发 非运营
					'<div class="placing-area zhx-ctc-down-going"> ' +
						//下行待发 ' +
						'<div class="downgo-waiting-area">' +
							'<ul>' +
								'<li ng-repeat="bus in __lineBusArrObject.downReadyBus track by $index" class="iconfont icon-bus">' +
									'<span class="bus-no">{{ bus[__busKeyMap.busNoKey] }}</span>' +
									'<span class="bus-plan-time">{{ bus[__busKeyMap.planTimeKey] | busTimeFilter }}</span>' +
								'</li>' +
							'</ul>' +
						'</div> ' +
						//非运营 ' +
						'<div class="downgo-non-service">' +
							'<ul>' +
								'<li ng-repeat="bus in __lineBusArrObject.downNonServiceBus track by $index" class="iconfont icon-bus">' +
									'<span class="bus-no">{{ bus[__busKeyMap.busNoKey] }}</span>' +
									'<span class="bus-plan-time">{{ bus[__busKeyMap.planTimeKey] | busTimeFilter }}</span>' +
								'</li>' +
							'</ul>' +
						'</div> ' +
					'</div> ' +
					//直线图
					'<zhx-ctc-liear-map class="zhx-ctc-liear-map"></zhx-ctc-liear-map>' +
					// 底部 离线 停运区域
					'<div class="zhx-ctc-center-bottom"> ' +
						'<div class="bottom-placing-area offline-bus">'+
							'<ul>' +
								'<li ng-repeat="bus in __lineBusArrObject.offLineBus track by $index" class="iconfont icon-bus">' +
									'<span class="bus-no">{{ bus[__busKeyMap.busNoKey] }}</span>' +
								'</li>' +
							'</ul>' +
						'</div> ' +
						'<div class="bottom-placing-area offline-none-service">' +
							'<ul>' +
									'<li ng-repeat="bus in __lineBusArrObject.stopServiceBus track by $index" class="iconfont icon-bus">' +
										'<span class="bus-no">{{ bus[__busKeyMap.busNoKey] }}</span>' +
									'</li>' +
								'</ul>' +
						'</div> ' +
					'</div> ' +
				'</div> ' +
			'</div> ');

		//直线图模板
		$templateCache.put('zhx.ctc.liearMap.vicco',
			'<div class="zhx-ctc-liearMap-wrapper" id="zhx-ctc-liearMap">' +
				'<div class="ctc-liearMap-up" ng-if="__upStationLineData">' +
					'<div class="ctc-liear-line-wrapper">' +
						'<div class="ctc-liear-line" ng-if="__upStationLineData.length">' +
							//上行线路上的车辆
							'<ul class="ctc-line-bus">' +
								'<li ng-repeat=" bus in __lineBusArrObject.upLineBus track by $index " ' +
								' ng-style="{ left: bus.__relativePos , top : bus.__relativeTop }">' +
									'<span class="zhx-ctc-bus-icon up-bus iconfont icon-bus" ' +
									'zhx-ring-button="ringOptions" ' +
									'ring-data="bus" '+
									'ng-mouseover="hoverBusInfo($event,bus);" ng-mouseleave="finishAnimation($event);"></span>' +
									'<span class="zhx-ctc-bus-info"></span>' +
								'</li>'+
							'</ul>'+
							//上行站点循环
							'<ul class="ctc-line-station">' +
								'<li ng-repeat=" station in __upStationLineData track by $index " ' +
								'ng-style="{ left : station.__relativePos }">' +
									'<span class="line-map-dot" ng-class="::{ \'firstStation-dot\' : $first, \'lastStation-dot\': $last }" ' + 
									'ng-mouseover="showStationInfo($event,station);" ng-mouseleave="finishAnimation($event);"></span>' +
									'<span class="line-map-Name" ng-bind="station[__lineKeyMap.stationNameKey]"></span>' +
								'</li>' +
							'</ul>' +
						'</div>' +
					'</div>' +
				'</div>' +
				'<div class="ctc-liearMap-down" ng-if="__downStationLineData">' +
					'<div class="ctc-liear-line-wrapper">' +
						'<div class="ctc-liear-line" ng-if="__downStationLineData.length">' +
							//下行线路上的车辆
							'<ul class="ctc-line-bus">' +
								'<li ng-repeat=" bus in __lineBusArrObject.downLineBus track by $index " ' +
								' ng-style="{ right: bus.__relativePos, top : bus.__relativeTop }">' +
									'<span class="zhx-ctc-bus-icon down-bus iconfont icon-bus" ' +
									'zhx-ring-button="ringOptions" ' +
									'ring-data="bus" '+
									'ng-mouseover="hoverBusInfo($event,bus);" ng-mouseleave="finishAnimation($event);"></span>' +
									'<span class="zhx-ctc-bus-info"></span>' +
								'</li>'+
							'</ul>'+
							//下行站点循环
							'<ul class="ctc-line-station">' +
								'<li ng-repeat=" station in __downStationLineData track by $index " ' +
								'ng-style="{ right : station.__relativePos }">' +
									'<span class="line-map-dot" ng-class="::{ \'firstStation-dot\' : $first, \'lastStation-dot\': $last }" ' +
									'ng-mouseover="showStationInfo($event,station)" ng-mouseleave="finishAnimation($event);"></span>' +
									'<span class="line-map-Name" ng-bind="station[__lineKeyMap.stationNameKey]"></span>' +
								'</li>' +
							'</ul>' +
						'</div>' +
					'</div>' +
				'</div>' +
			'</div>');

		//直线图车辆鼠标悬浮弹出框模板
		$templateCache.put('zhx.ctc.liearMap.layer.bus.vicco',
			'<div class="zhx-ctc-bus-layer">'+
				'<div class="bus-no"><span>{{ bus[__busKeyMap.busNoKey] }}</span></div>' +
				'<ul>' +
					'<li>司机: </li>' +
					'<li>运营状态: </li>' +
					'<li>当前速度: </li>' +
					'<li>满载率: </li>' +
					'<li>报警: </li>' +
					'<li>当前站点: </li>' +
					'<li>车辆班次: </li>' +
					'<li>下一趟次: </li>' +
					'<li>发车时间: </li>' +
				'</ul>' +
			'</div>');

		//直线图站点鼠标悬浮弹出框模板
		$templateCache.put('zhx.ctc.liearMap.layer.station.vicco',
			'<div class="zhx-ctc-station-layer">' +
				'<div class="station-name"><span>{{ station[__lineKeyMap.stationNameKey] }}</span></div>' +
				'<ul>' +
					'<li>过站车辆: </li>' +
					'<li>进站时间: </li>' +
					'<li>出站时间: </li>' +
					'<li>停站: </li>' +
				'</ul>' +
			'</div>');

		//报警信息
		$templateCache.put('zhx.ctc.alarm.vicco',
			'<div class="zhx-alarm-grid">' +
				'<div class="zhx-alarm-header">' +
					'<ul>' +
						'<li ng-repeat="column in ::gridColumn track by $index" ng-bind="::column.displayName" ng-style="::{ width : column.width || \'auto\', flex : !column.width ? 1 : \'none\' }"></li>' +
						'<li>操作</li>' +
					'</ul>' +
				'</div>' +
				'<div class="zhx-alarm-body"> ' +
					'<span class="no-data" ng-if="!gridData.length">暂无报警信息</span>' +
					'<zhx-alarm-row ng-repeat="row in gridData | orderBy : levelKey : true " ' +
					'ng-class="::{ redRow : row[levelKey] == level.high, yellowRow : row[levelKey] == level.middle, greenRow : row[levelKey] == level.low }"></zhx-alarm-row>' +
				'</div>' +
			'</div>');
		//报警行
		$templateCache.put('zhx.ctc.alarmRow.vicco',
			'<ul>' +
				'<zhx-alarm-cell ng-repeat="column in gridColumn track by $index " row="row" column="column"></zhx-alarm-cell>' +
				'<li ng-click="processAlarm($event,row)" >[ 处理 ]</li>' +
			'</ul>');
		//报警单元格
		$templateCache.put('zhx.ctc.alarmCell.vicco',
			'<li ng-bind=" ::row[ column.name ] " ' +
			'ng-style="::{ width : column.width || \'auto\', flex : !column.width ? 1 : \'none\' }" ></li>');

		//预测信息
		$templateCache.put('zhx.ctc.forecastGrid.vicco',
			'<div class="zhx-forecast-grid">' +
				'<div class="zhx-forecast-grid-filter iconfont icon-gengduo" ng-click="showFilter($event)">' +
					'<div class="zhx-forecast-filter-main"></div>' +
				'</div>' +
				'<div class="zhx-forecast-grid-wrapper">' +
					'<div class="zhx-forecast-header">' +
						'<ul>' +
							'<li ng-repeat="column in ::gridColumn track by $index" ng-bind="::column.displayName" ng-style="::{ width : column.width || \'auto\', flex : !column.width ? 1 : \'none\' }"></li>' +
							'<li style="min-width:60px;flex:1;">操作</li>' +
						'</ul>' +
					'</div>' +
					'<div class="zhx-forecast-body-wrapper">' +
						'<div class="zhx-forecast-body"> ' +
							'<span class="no-data" ng-if="!gridData.length">暂无预测数据</span>' +
							'<zhx-forecast-row ng-repeat="row in gridData track by $index"></zhx-forecast-row>' +
						'</div>' +
					'</div>' +
				'</div>' +
			'</div>');
		//预测行
		$templateCache.put('zhx.ctc.forecastRow.vicco',
			'<ul>' +
				'<zhx-forecast-cell ng-repeat="column in gridColumn track by $index " row="row" column="column"></zhx-forecast-cell>' +
				'<li style="min-width:60px;flex:1;" ng-click="processForecast($event,row)" >[ 处理 ]</li>' +
			'</ul>');
		//预测单元格
		$templateCache.put('zhx.ctc.forecastCell.vicco',
			'<li ng-bind=" ::row[ column.name ] " ' +
			'ng-style="::{ width : column.width || \'auto\', flex : !column.width ? 1 : \'none\' }" ></li>');
	
	}]);


})()